package com.example.demo2.controller.requests;

import com.example.demo2.model.Drink;
import org.joda.money.CurrencyUnit;
import org.joda.money.Money;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class RouterController {
    @GetMapping("/")
    public String Index(){
        return "manage/login";
    }
    @GetMapping("/manage/index")
    public String adminindex(){
        return "manage/index";
    }
    @GetMapping("/manage/welcome")
    public String Welcome(){
        return "manage/welcome";
    }
    @GetMapping("/menu/drink")
    public String index(){
        return "drink/index";
    }
    @GetMapping("/drink/addform")
    public String addIndex(){
        return "drink/add";
    }

//    @GetMapping("/drink/addform")
//    public ModelAndView drinkUpdateFrom(@RequestParam Integer id){
//        ModelAndView mv=new ModelAndView("drink/edit");
//        Drink build= Drink.builder().id(13)
//                .name("茉莉花茶")
//                .price(Money.of(CurrencyUnit.of("CNY"),13))
//                .build();
//        mv.addObject("data",build);
//        return mv;
//    }

    @GetMapping("/id")
    public String deleteDrink(){
        return "drink/add";
    }

}
